The Dataverse files contain all scripts necessary to reproduce the results of the paper "The European Court of Justice and legal European integration" by Thomas König & Stefan Eschenwecker

A few remarks are necessary:

1) R-package versions
The analyses were conducted with the following package versions:
- tidyverse 2.0.0  
- rstan 2.32.7  
- patchwork 1.3.1  
- brms 2.22.0  
- modelsummary 2.4.0  
- future.apply 1.20.0  
- tidybayes 3.0.7  
- vtable 1.4.8  
- cmdstanr 2.36.0 

2) Directory structure
The scripts assume the following directory structure relative to an R-Project file:
- Court (a folder containing all materials of the project)
- Data (a subfolder of Court containing the dataset "PreparedCourtData.csv"
- Models (a subfolder of Court containing the save regression model objects -> ending with ".rds"

3) Reproducing results in paper and online appendix
- To reproduce figures and tables only, it is not necessary to re-run the scripts starting with `"Model_"`.  
- The regression objects (".rds" files) are already saved in the "Models" subfolder and can be directly loaded by the respective scripts.  
- This avoids re-estimating the models, which is computationally intensive and can take a long time.  
- If you wish to re-run the "Model_" scripts, you need to install cmdstanr (see https://mc-stan.org/cmdstanr/ for documentation).  

4) Regression tables
- The final regression tables were slightly adjusted manually compared to the raw output from the modelsummary and vtable packages.  
- Adjustments were made to improve LaTeX formatting and to add additional information.  
- All coefficients and credible intervals are identical to the raw outputs and can be verified with the summary() function on the respective regression objects.  

5) The scripts produce the following outputs:
- DescriptiveMSPlots.R -> Figures A1 + A2 in online appendix.
- DescriptivesTable.R -> Table A1 in online appendix.
- Model_AddCaseCharacteristics -> Regression model object for Table A4 in online appendix.
- Model_EqPrecision.R -> Regression model object for Location-Only Model in Table 1 in main text.
- Model_FullData.R -> Regression model object for Full Data Model in Table A2 in online appendix.
- Model_NoHSAG.R -> Regression model object for No HS AG Model in Table A2 in online appendix.
- Model_NoMS.R -> Regression model object for No MS Model in Table A3 in online appendix.
- Model_SumMSObs.R -> Regression model object for Sum MS Pos Model in Table A3 in online appendix.
- Model_UnEqPrecision.R -> Regression model object for Combined Model in Table 1 in main text + Figure A4 in online appendix.
- QoIDispersion.R -> Figure 5 in main text.
- QoIPredictedProbabilities.R -> Figure 3 in main text.
- QoIPredictedProbabilities_LocOnly.R -> Figure A3 in online appendix.
- QoIPredictions.R -> Figure 4 in main text.
- PrepareData.R -> Produces the dataset "PreparedCourtData.csv" for analysis.
- RegressionTables.R -> Table 1 in main text and Tables A2, A3, and A4 in online appendix.
- Residuals.R -> Figure 2 in main text.
